package Requests;

import java.io.PrintWriter;
import default_package.InputParser;

public class PUTRequest extends HTTPRequest {

	public PUTRequest(String[] input, PrintWriter pw, String host) {
		super(input, pw, host);
	}
	
	@Override
	public void execute() {
//		String temp = (getInput()[0] + " " + InputParser.getFilePath(getInput()[1])+
//				" " + getInput()[3] + "\r\n");
//		getPrintWriter().print(temp);
//		getPrintWriter().flush();
//		// Sending headers to server
//		while (!(temp = InputParser.readLine()).equals("")) {
//		getPrintWriter().print(temp + "\r\n");
//		getPrintWriter().flush();
//		}
//		getPrintWriter().print("\r\n");
//		getPrintWriter().flush();
//		// Send content to server
//		while (!(temp = InputParser.readLine()).equals("")) {
//			getPrintWriter().print(temp + "\r\n");
//			getPrintWriter().flush();
//			}
//		getPrintWriter().print("\r\n\r\n");
//		getPrintWriter().flush();
		String commandLine = getCommandToServer();
		//getPrintWriter().print(temp);
		//getPrintWriter().flush();
		// Sending headers to server
		commandLine = commandLine.concat(getTextBlock());
		commandLine = commandLine.concat("\r\n");
		commandLine = commandLine.concat(getTextBlock());
		commandLine = commandLine.concat("\r\n");
		getPrintWriter().print(commandLine);
		getPrintWriter().flush();
	}
}
